(defun x-maximize-frame ()
  (x-send-client-message
    nil 0 nil "_NET_WM_STATE" 32
    '(1 "_NET_WM_STATE_MAXIMIZED_HORZ" 0))
  (x-send-client-message
    nil 0 nil "_NET_WM_STATE" 32
    '(1 "_NET_WM_STATE_MAXIMIZED_VERT" 0)))
   
(defun x-fullscreen ()  
  (x-send-client-message  
    nil 0 nil "_NET_WM_STATE" 32  
    '(2 "_NET_WM_STATE_FULLSCREEN" 0)))  

(defun w32-maximize-frame ()
  (w32-send-sys-command 61488))
  
;(defun w32-restore-frame ()
;  (w32-send-sys-command 61728))

(defun w32-fullscreen ()
  "not implemented")

;(global-set-key [f11] 'fullscreen)  
(defun maximize-frame ()
  (interactive)
  (cond ((eq window-system 'w32) (w32-maximize-frame))
	((memq window-system '(x mac)) (x-maximize-frame))))

(defun fullscreen ()
  (interactive)
  (cond ((eq window-system 'w32) (w32-fullscreen))
	((memq window-system '(x mac)) (x-fullscreen))))

(provide 'maximize)
